package com.gitee.pifeng.monitoring.ui.business.web.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.pifeng.monitoring.ui.business.web.vo.XjDataLinkVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

/**
 * <p>
 * 数链对象表
 * </p>
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("xj_data_link")
@Schema(description = "数据链路对象")
public class XjDataLink implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "ld_id", type = IdType.AUTO)
    private Long ldId;

    @Schema(description = "起始节点")
    @TableField("from_node")
    private String fromNode;

    @Schema(description = "结束节点")
    @TableField("to_node")
    private String toNode;

    @Schema(description = "数据源主键ID")
    @TableField("db_id")
    private Long dbId;

    @Schema(description = "坐标X")
    @TableField("node_x")
    private Double nodeX;

    @Schema(description = "坐标Y")
    @TableField("node_y")
    private Double nodeY;

    @Schema(description = "节点备注")
    @TableField("node_remark")
    private Double nodeRemark;

    @Schema(description = "线条颜色")
    @TableField("link_color")
    private String linkColor;

    @Schema(description = "线条类型")
    @TableField("link_type")
    private String linkType;

    @Schema(description = "线条内容")
    @TableField("link_remark")
    private String linkRemark;

    @Schema(description = "插入时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("create_time")
    private Date createTime;

    @Schema(description = "链路名称")
    @TableField("data_link_name")
    private String dataLinkName;

    @Schema(description = "链路备注")
    @TableField("remark")
    private String remark;

    @Schema(description = "连线数据")
    @TableField(exist = false)
    private ArrayList<XjDataLink> links;
}
